# 列表数据分奇数和偶数求和，并返回两个结果
def odd_and_even_sum(n):
    odd = []
    even = []
    for i in n:
        if i%2==0:
            odd.append(i)
        else:
            even.append(i)
    return sum(odd),sum(even)

list = [1,2,3,4,5,6,7,8,9,10]
a,b = odd_and_even_sum(list)
print("偶数项的和 = {}".format(a))
print("奇数项的和 = {}".format(b))